import 'package:cms/models/single.dart';
import 'package:components/pull_down_refresh/controller.dart';

class ListState {
  List<SingleModel> list = [];
  bool isLoading;
  LaraPressRefreshController refreshController;
  ListState({
    this.list = const <SingleModel>[],
    this.isLoading = true,
    required this.refreshController,
  });

  factory ListState.initial() {
    return ListState(
      list: [],
      isLoading: true,
      refreshController: LaraPressRefreshController(),
    );
  }

  ListState copyWith({
    List<SingleModel>? list,
    bool? isLoading,
    LaraPressRefreshController? refreshController,
  }) {
    return ListState(
      list: list ?? this.list,
      isLoading: isLoading ?? this.isLoading,
      refreshController: refreshController ?? this.refreshController,
    );
  }
}
